<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Counter</title>
  </head>
  <body>
    <div id="app"></div>
    <script>const start = performance.now()</script>
    <script src="../../dist/eva.js"></script>
    <script>

      const app = new EVA.default()
      app.model({
        name: 'counter',
        state: {count: 0},
        mutations: {
          INCREMENT(state) {state.count++}
        }
      })
      const Home = {
        computed: {
          count() {
            return this.$store.state.counter.count
          }
        },
        render(h) {
          return h('button', {
            on: {
              click: () => this.$store.commit('INCREMENT')
            }
          }, this.count)
        }
      }
      app.router(route => [
        route('/', Home)
      ])
      app.start('#app')
    </script>
    <script>console.log(`total init time: ${performance.now() - start}ms`)</script>
  </body>
</html>
